python-math #31: ci: run postgres integration tests - #2637
Draft
jucor wants to merge 1 commit into
Draft
Conversation
This was referenced Jul 18, 2026
Closed
Closed
Closed
Closed
Closed
Closed
Closed
Closed
Closed
Draft
jucor
marked this pull request as draft
July 18, 2026 13:28
jucor
force-pushed
the
spr/edge/62486a46
branch
2 times, most recently
from
July 18, 2026 13:35
94a5915 to
0e191f5
Compare
This was referenced Jul 18, 2026
Delphi Coverage Report
|
This was referenced Jul 24, 2026
Draft
Draft
Draft
Draft
python-math #43: docs(delphi): s7 goal state + journal — mode collapse executed, battery 20/20
#2672
Draft
Draft
Draft
Draft
## What Make the opt-in Postgres integration tests actually execute in CI, and share the provisioning path. - Refactor `tests/poller/test_integration_postgres.py` to obtain its database via the shared `require_polis_postgres()` helper (introduced in the T2 commit of this stack) instead of its own inline throwaway-docker fixture on fixed port 5435. It now applies migrations 000000 + 000006 and uses an ephemeral port (xdist-safe), or the CI service. - `python-ci.yml` step 6: export `POLIS_TEST_POSTGRES_URL` pointing at the compose `postgres` service (`docker-compose.test.yml`), whose image already bakes the polis migrations via `docker-entrypoint-initdb.d` — so the `votes` / `votes_latest_unique` schema and the `on_vote_insert_update_unique_table` rule are present (equivalent to an explicit migration-apply step). Also copy `delphi/scripts` into the container so `tests/test_generator_vote_copy.py` can import the cold-start generator under test. With `POLIS_TEST_POSTGRES_URL` set, `require_polis_postgres` verifies the schema and yields the URL (no docker-in-docker needed); both integration tests then RUN rather than self-skip. ## Testing Verified locally against a shared migrated Postgres via `POLIS_TEST_POSTGRES_URL`: - `tests/poller/test_integration_postgres.py` — PASSED - `tests/test_generator_vote_copy.py` — PASSED (2 passed in 0.84s) commit-id:62486a46
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Make the opt-in Postgres integration tests actually execute in CI, and share the provisioning path.
tests/poller/test_integration_postgres.pyto obtain its database via the sharedrequire_polis_postgres()helper (introduced in the T2 commit of this stack) instead of its own inline throwaway-docker fixture on fixed port 5435. It now applies migrations 000000 + 000006 and uses an ephemeral port (xdist-safe), or the CI service.python-ci.ymlstep 6: exportPOLIS_TEST_POSTGRES_URLpointing at the composepostgresservice (docker-compose.test.yml), whose image already bakes the polis migrations viadocker-entrypoint-initdb.d— so thevotes/votes_latest_uniqueschema and theon_vote_insert_update_unique_tablerule are present (equivalent to an explicit migration-apply step). Also copydelphi/scriptsinto the container sotests/test_generator_vote_copy.pycan import the cold-start generator under test.With
POLIS_TEST_POSTGRES_URLset,require_polis_postgresverifies the schema and yields the URL (no docker-in-docker needed); both integration tests then RUN rather than self-skip.Testing
Verified locally against a shared migrated Postgres via
POLIS_TEST_POSTGRES_URL:tests/poller/test_integration_postgres.py— PASSEDtests/test_generator_vote_copy.py— PASSED (2 passed in 0.84s)commit-id:62486a46
Stack: